package projorientado.ocr.vfeature;

import projorientado.spi.GenericServiceProviderInterface;
import projorientado.spi.ServiceProvider;


public class FeaturesExtractorProvider extends GenericServiceProviderInterface<FeaturesExtractor> {
    
    private static final FeaturesExtractorProvider instance = new FeaturesExtractorProvider();
    
    static {
        instance.registerServiceProvider("pointExtrator", new ServiceProvider<FeaturesExtractor>() {

            public FeaturesExtractor getService(String s) {
                int m = Integer.parseInt(s);
                return new FeaturesExtractor.PointExtractor(m);
            }
            
        });
    }
    
    private FeaturesExtractorProvider() {
        
    }
    
    public static FeaturesExtractorProvider getInstance() {
        return instance;
    }
    
    public static FeaturesExtractor getFeaturesExtractor(String s) {
        return instance.getService(s);
    }
    
    public static FeaturesExtractor getFeaturesExtractor(String name, String param) {
        return instance.getService(name, param);
    }
}
